﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using FbKPI.Model;
using FbKPI.Facade;
using System.Text;
using System.Web.Script.Serialization;
using System.Collections.ObjectModel;
using System.Web.Script.Services;
using System.Security.Cryptography;
using System.IO;

namespace FBKPI.Serializer
{
    /// <summary>
    /// Summary description for MenuSerializer
    /// </summary>
    public class MenuSerializer : IHttpHandler
    {

        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/json";
            string result = this.GetAllData_Backup();
            context.Response.Write(result);
        }

        public bool IsReusable
        {
            get
            {
                return false;
            }
        }

        private string GetAllData_Backup()
        {
            Employee User = new EmployeeFacade().GetEmployeeByID(Convert.ToInt32(HttpContext.Current.Request.Params["User"]));
            string menu = string.Empty;

            if (User!=null)
            {
                //IList<Employee> Underlings = new EmployeeFacade().GetUnderlingBySuperiorID(new Employee() { ID = User.ID });
                bool isAssignee = User.Privilege == null ? false : User.Privilege.isAssignee;
                bool isBreakDown = User.Privilege == null ? false : User.Privilege.isBreakDown;
                bool isAddKPI = User.Privilege == null ? false : User.Privilege.isAddKPI;
                bool isPickKPI = User.Privilege == null ? false : User.Privilege.isPickKPI;
                
                string UserID = EncryptDecryptClass.Encrypt(User.ID.ToString());
                string UserParam = EncryptDecryptClass.Encrypt("User");
                //UserID = EncryptDecryptClass.Decrypt(UserID);

                //menu = "[{\"key\": \"1\", \"title\": \"Home\", \"href\": \"/Home?User=" + User.ID.ToString() + "\"}";
                //menu += ",{\"key\": \"2\", \"title\": \"Business Group\", \"href\": \"/BusinessGroup?"+"User"+"=" + UserID + "\"}";

                menu = "[{\"key\": \"1\", \"title\": \"Home\", \"href\": \"../Pages/Default.aspx" + "\"}";
                menu += ",{\"key\": \"2\", \"title\": \"Business Group\", \"href\": \"../Pages/BusinessGroupPage.aspx" + "\"}";
                
                
                

                if (User.isAdmin)
                {
                    

                    //menu += ",{\"key\": \"7\", \"title\": \"Employee KPI\", \"href\": \"/KPICurrentAdmin" + "\"}";
                    //menu += ",{\"key\": \"4\", \"title\": \"Organization\", \"folder\": true, \"children\": [";
                    //menu += "{\"key\": \"4_1\", \"title\": \"Division\", \"href\": \"/Division" + "\" }";
                    //menu += ",{\"key\": \"4_2\", \"title\": \"Department\", \"href\": \"/Department" + "\" }";
                    //menu += ",{\"key\": \"4_3\", \"title\": \"Section\", \"href\": \"/Section" + "\" }";
                    //menu += ",{\"key\": \"4_4\", \"title\": \"Sub Section\", \"href\": \"/SubSection"+ "\" }";
                    //menu += ",{\"key\": \"4_5\", \"title\": \"Job Position\", \"href\": \"/JobPosition" + "\" }";
                    //menu += ",{\"key\": \"4_6\", \"title\": \"Privilege\", \"href\": \"/Privilege" + "\" }";
                    //menu += ",{\"key\": \"4_7\", \"title\": \"Employee\", \"href\": \"/Employee" + "\" }";
                    //menu += "]}";
                    //menu += ",{\"key\": \"3\", \"title\": \"KPI Rule Assignment\", \"folder\": true, \"children\": [";
                    //menu += "{\"key\": \"3_1\", \"title\": \"RGM Type\", \"href\": \"/RGMType" + "\" }";
                    //menu += ",{\"key\": \"3_2\", \"title\": \"RGM\", \"href\": \"/RGM" + "\" }";
                    //menu += ",{\"key\": \"3_3\", \"title\": \"Branch\", \"href\": \"/Branch" + "\" }";
                    //menu += ",{\"key\": \"3_4\", \"title\": \"Sub Branch\", \"href\": \"/SubBranch" + "\" }";
                    //menu += "]}";


                    //menu += ",{\"key\": \"5\", \"title\": \"KPI Template Setup\", \"folder\": true, \"children\": [";
                    //menu += "{\"key\": \"5_1\", \"title\": \"Group\", \"href\": \"/GroupKPI" + "\" }";
                    //menu += ",{\"key\": \"5_2\", \"title\": \"Category\", \"href\": \"/CategoryKPI" + "\" }";
                    //menu += ",{\"key\": \"5_3\", \"title\": \"Type\", \"href\": \"/TypeKPI" + "\" }";
                    //menu += ",{\"key\": \"5_4\", \"title\": \"Sub Type\", \"href\": \"/SubTypeKPI" + "\" }";
                    //menu += ",{\"key\": \"5_5\", \"title\": \"Unit Of Measure\", \"href\": \"/UoMKPI" + "\" }";
                    //menu += ",{\"key\": \"5_6\", \"title\": \"UoM Detail\", \"href\": \"/UoMDetailKPI" + "\" }";
                    //menu += "]}";

                    //menu += ",{\"key\": \"6\", \"title\": \"KPI\", \"folder\": true, \"children\": [";
                    //menu += "{\"key\": \"6_1\", \"title\": \"Set KPI\", \"href\": \"/KPI" + "\" }";
                    //menu += "]}";
                    menu += ",{\"key\": \"8\", \"title\": \"Setup Year\", \"href\": \"../Pages/SetupYearPage.aspx" + "\"}";
                    //menu += ",{\"key\": \"7\", \"title\": \"Employee KPI\", \"href\": \"../Pages/KPICurrentAdmin.aspx" + "\"}";
                    menu += ",{\"key\": \"4\", \"title\": \"Organization\", \"folder\": true, \"children\": [";
                    menu += "{\"key\": \"4_1\", \"title\": \"Division\", \"href\": \"../Pages/DivisionPage.aspx" + "\" }";
                    menu += ",{\"key\": \"4_2\", \"title\": \"Department\", \"href\": \"../Pages/DepartmentPage.aspx" + "\" }";
                    menu += ",{\"key\": \"4_3\", \"title\": \"Section\", \"href\": \"/../Pages/SectionPage.aspx" + "\" }";
                    menu += ",{\"key\": \"4_4\", \"title\": \"Sub Section\", \"href\": \"../Pages/SubSectionPage.aspx" + "\" }";
                    menu += ",{\"key\": \"4_5\", \"title\": \"Job Position\", \"href\": \"../Pages/JobPositionPage.aspx" + "\" }";
                    menu += ",{\"key\": \"4_6\", \"title\": \"Privilege\", \"href\": \"/../Pages/PrivilegePage.aspx" + "\" }";
                    menu += ",{\"key\": \"4_7\", \"title\": \"Employee\", \"href\": \"/../Pages/EmployeePage.aspx" + "\" }";
                    menu += "]}";
                    menu += ",{\"key\": \"3\", \"title\": \"KPI Rule Assignment\", \"folder\": true, \"children\": [";
                    menu += "{\"key\": \"3_1\", \"title\": \"RGM Type\", \"href\": \"../Pages/RGMTypePage.aspx" + "\" }";
                    menu += ",{\"key\": \"3_2\", \"title\": \"RGM\", \"href\": \"../Pages/RGMPage.aspx" + "\" }";
                    menu += ",{\"key\": \"3_3\", \"title\": \"Branch\", \"href\": \"../Pages/LocationPage.aspx" + "\" }";
                    menu += ",{\"key\": \"3_4\", \"title\": \"Sub Branch\", \"href\": \"../Pages/SubBranchPage.aspx" + "\" }";
                    menu += "]}";


                    menu += ",{\"key\": \"5\", \"title\": \"KPI Template Setup\", \"folder\": true, \"children\": [";
                    menu += "{\"key\": \"5_1\", \"title\": \"Group\", \"href\": \"../Pages/GroupKPIPage.aspx" + "\" }";
                    menu += ",{\"key\": \"5_2\", \"title\": \"Category\", \"href\": \"../Pages/CategoryKPIPage.aspx" + "\" }";
                    menu += ",{\"key\": \"5_3\", \"title\": \"Type\", \"href\": \"../Pages/TypeKPIPage.aspx" + "\" }";
                    menu += ",{\"key\": \"5_4\", \"title\": \"Sub Type\", \"href\": \"../Pages/SubTypeKPIPage.aspx" + "\" }";
                    menu += ",{\"key\": \"5_5\", \"title\": \"Unit Of Measure\", \"href\": \"../Pages/UoMPage.aspx" + "\" }";
                    menu += ",{\"key\": \"5_6\", \"title\": \"UoM Detail\", \"href\": \"../Pages/UoMDetailPage.aspx" + "\" }";
                    menu += "]}";

                    menu += ",{\"key\": \"6\", \"title\": \"KPI\", \"folder\": true, \"children\": [";
                    menu += "{\"key\": \"6_1\", \"title\": \"Set KPI\", \"href\": \"../Pages/KPIPage.aspx" + "\" }";
                    menu += "]}";

                    menu += ",{\"key\": \"10\", \"title\": \"Report\", \"folder\": true, \"children\": [";
                    menu += "{\"key\": \"7\", \"title\": \"Employee KPI\", \"href\": \"../Pages/KPICurrentAdmin.aspx" + "\"}";
                    menu += "]}";

                    menu += ",{\"key\": \"9\", \"title\": \"Log Aplikasi\", \"href\": \"../Pages/sysLogPage.aspx" + "\"}";



                }
                else if (isAssignee && isBreakDown)
                {


                    //menu += ",{\"key\": \"3\", \"title\": \"Employee KPI\", \"href\": \"../Pages/KPICurrent.aspx" + "\"}";
                    menu += ",{\"key\": \"4\", \"title\": \"KPI\", \"folder\": true, \"children\": [";

                   

                    if (isAddKPI == false && isPickKPI == false)
                    {
                        menu += "{\"key\": \"4_3\", \"title\": \"Breakdown KPI\", \"href\": \"../Pages/KPIBreakDownPage.aspx" + "\" }";
                        menu += ",{\"key\": \"4_4\", \"title\": \"Assign KPI\", \"href\": \"../Pages/KPIAssignDetailPage.aspx" + "\" }";
                        menu += ",{\"key\": \"4_5\", \"title\": \"Achievement\", \"href\": \"../Pages/AchievementPage.aspx" + "\" }";
                        menu += ",{\"key\": \"4_6\", \"title\": \"Verification\", \"href\": \"../Pages/VerificatePage.aspx" + "\" }";

                        

                        menu += "]}";

                        menu += ",{\"key\": \"5\", \"title\": \"Report\", \"folder\": true, \"children\": [";
                        menu += "{\"key\": \"5_1\", \"title\": \"Annual Report\", \"href\": \"../Pages/ReportAnnualKPIPage.aspx" + "\" }";
                        menu += ",{\"key\": \"5_2\", \"title\": \"KPI Handover\", \"href\": \"../Pages/ReportKPIReceiptPage.aspx" + "\" }";
                        menu += ",{\"key\": \"5_3\", \"title\": \"KPI Manual\", \"href\": \"../Pages/ReportKPIManualPage.aspx" + "\" }";

                        menu += "]}";
                    }
                    else
                    {

                        if (isPickKPI)
                        {
                            menu += "{\"key\": \"4_2\", \"title\": \"Available KPI\", \"href\": \"../Pages/AvailableKPIPage.aspx" + "\" }";
                            menu += ",{\"key\": \"4_3\", \"title\": \"Breakdown KPI\", \"href\": \"../Pages/KPIBreakDownPage.aspx" + "\" }";
                        }
                        else
                        {
                            menu += "{\"key\": \"4_3\", \"title\": \"Breakdown KPI\", \"href\": \"../Pages/KPIBreakDownPage.aspx" + "\" }";
                        }

                        
                        menu += ",{\"key\": \"4_4\", \"title\": \"Assign KPI\", \"href\": \"../Pages/KPIAssignDetailPage.aspx" + "\" }";
                        menu += ",{\"key\": \"4_5\", \"title\": \"Achievement\", \"href\": \"../Pages/AchievementPage.aspx" + "\" }";
                        menu += ",{\"key\": \"4_6\", \"title\": \"Verification\", \"href\": \"../Pages/VerificatePage.aspx" + "\" }";

                        if (isAddKPI)
                        {
                            menu += ",{\"key\": \"4_7\", \"title\": \"Add KPI\", \"href\": \"../Pages/KPIAddPage.aspx" + "\" }";
                        }

                        menu += "]}";

                        menu += ",{\"key\": \"5\", \"title\": \"Report\", \"folder\": true, \"children\": [";
                        menu += "{\"key\": \"3\", \"title\": \"Employee KPI\", \"href\": \"../Pages/KPICurrent.aspx" + "\"}";
                        menu += ",{\"key\": \"5_4\", \"title\": \"Employee KPI Weight\", \"href\": \"../Pages/EmployeeKPITotalWeightPage.aspx" + "\" }";
                        menu += ",{\"key\": \"5_1\", \"title\": \"Annual Report\", \"href\": \"../Pages/ReportAnnualKPIPage.aspx" + "\" }";
                        menu += ",{\"key\": \"5_2\", \"title\": \"KPI Handover\", \"href\": \"../Pages/ReportKPIReceiptPage.aspx" + "\" }";
                        menu += ",{\"key\": \"5_3\", \"title\": \"KPI Manual\", \"href\": \"../Pages/ReportKPIManualPage.aspx" + "\" }";

                        menu += "]}";
                    }
                      
                    
                }
                else
                {
                    
                    menu += ",{\"key\": \"3\", \"title\": \"KPI\", \"folder\": true, \"children\": [";
                    menu += "{\"key\": \"3_1\", \"title\": \"Achievement\", \"href\": \"../Pages/AchievementPage.aspx" + "\" }";
                    menu += "]}";

                    menu += ",{\"key\": \"4\", \"title\": \"Report\", \"folder\": true, \"children\": [";
                    menu += "{\"key\": \"4_1\", \"title\": \"Annual Report\", \"href\": \"../Pages/ReportAnnualKPIPage.aspx" + "\" }";
                    menu += ",{\"key\": \"4_2\", \"title\": \"KPI Handover\", \"href\": \"../Pages/ReportKPIReceiptPage" + "\" }";
                    menu += ",{\"key\": \"4_3\", \"title\": \"KPI Manual\", \"href\": \"../Pages/ReportKPIManualPage.aspx" + "\" }";
                    menu += "]}";
                }

                menu += "]";
            }
            return menu;
        }

        private string GetAllData()
        {
            Employee User = new EmployeeFacade().GetEmployeeByID(Convert.ToInt32(HttpContext.Current.Request.Params["User"]));
            string menu = string.Empty;

            if (User != null)
            {
                //IList<Employee> Underlings = new EmployeeFacade().GetUnderlingBySuperiorID(new Employee() { ID = User.ID });
                bool isAssignee = User.Privilege == null ? false : User.Privilege.isAssignee;
                bool isBreakDown = User.Privilege == null ? false : User.Privilege.isBreakDown;
                bool isAddKPI = User.Privilege == null ? false : User.Privilege.isAddKPI;
                bool isPickKPI = User.Privilege == null ? false : User.Privilege.isPickKPI;

                string UserID = EncryptDecryptClass.Encrypt(User.ID.ToString());
                string UserParam = EncryptDecryptClass.Encrypt("User");
               

                //menu = "[{\"key\": \"1\", \"title\": \"Home\", \"href\": \"../Pages/Default.aspx" + "\"}";
                //menu += ",{\"key\": \"2\", \"title\": \"Business Group\", \"href\": \"../Pages/BusinessGroupPage.aspx" + "\"}";




                if (User.isAdmin)
                {

                    menu += " <ul class='topnav'>";
                    menu += "<li><a href='#'>Home</a></li>";
                    menu += "</ul>";
                    
                    //menu += ",{\"key\": \"8\", \"title\": \"Setup Year\", \"href\": \"../Pages/SetupYearPage.aspx" + "\"}";
                    ////menu += ",{\"key\": \"7\", \"title\": \"Employee KPI\", \"href\": \"../Pages/KPICurrentAdmin.aspx" + "\"}";
                    //menu += ",{\"key\": \"4\", \"title\": \"Organization\", \"folder\": true, \"children\": [";
                    //menu += "{\"key\": \"4_1\", \"title\": \"Division\", \"href\": \"../Pages/DivisionPage.aspx" + "\" }";
                    //menu += ",{\"key\": \"4_2\", \"title\": \"Department\", \"href\": \"../Pages/DepartmentPage.aspx" + "\" }";
                    //menu += ",{\"key\": \"4_3\", \"title\": \"Section\", \"href\": \"/../Pages/SectionPage.aspx" + "\" }";
                    //menu += ",{\"key\": \"4_4\", \"title\": \"Sub Section\", \"href\": \"../Pages/SubSectionPage.aspx" + "\" }";
                    //menu += ",{\"key\": \"4_5\", \"title\": \"Job Position\", \"href\": \"../Pages/JobPositionPage.aspx" + "\" }";
                    //menu += ",{\"key\": \"4_6\", \"title\": \"Privilege\", \"href\": \"/../Pages/PrivilegePage.aspx" + "\" }";
                    //menu += ",{\"key\": \"4_7\", \"title\": \"Employee\", \"href\": \"/../Pages/EmployeePage.aspx" + "\" }";
                    //menu += "]}";
                    //menu += ",{\"key\": \"3\", \"title\": \"KPI Rule Assignment\", \"folder\": true, \"children\": [";
                    //menu += "{\"key\": \"3_1\", \"title\": \"RGM Type\", \"href\": \"../Pages/RGMTypePage.aspx" + "\" }";
                    //menu += ",{\"key\": \"3_2\", \"title\": \"RGM\", \"href\": \"../Pages/RGMPage.aspx" + "\" }";
                    //menu += ",{\"key\": \"3_3\", \"title\": \"Branch\", \"href\": \"../Pages/LocationPage.aspx" + "\" }";
                    //menu += ",{\"key\": \"3_4\", \"title\": \"Sub Branch\", \"href\": \"../Pages/SubBranchPage.aspx" + "\" }";
                    //menu += "]}";


                    //menu += ",{\"key\": \"5\", \"title\": \"KPI Template Setup\", \"folder\": true, \"children\": [";
                    //menu += "{\"key\": \"5_1\", \"title\": \"Group\", \"href\": \"../Pages/GroupKPIPage.aspx" + "\" }";
                    //menu += ",{\"key\": \"5_2\", \"title\": \"Category\", \"href\": \"../Pages/CategoryKPIPage.aspx" + "\" }";
                    //menu += ",{\"key\": \"5_3\", \"title\": \"Type\", \"href\": \"../Pages/TypeKPIPage.aspx" + "\" }";
                    //menu += ",{\"key\": \"5_4\", \"title\": \"Sub Type\", \"href\": \"../Pages/SubTypeKPIPage.aspx" + "\" }";
                    //menu += ",{\"key\": \"5_5\", \"title\": \"Unit Of Measure\", \"href\": \"../Pages/UoMPage.aspx" + "\" }";
                    //menu += ",{\"key\": \"5_6\", \"title\": \"UoM Detail\", \"href\": \"../Pages/UoMDetailPage.aspx" + "\" }";
                    //menu += "]}";

                    //menu += ",{\"key\": \"6\", \"title\": \"KPI\", \"folder\": true, \"children\": [";
                    //menu += "{\"key\": \"6_1\", \"title\": \"Set KPI\", \"href\": \"../Pages/KPIPage.aspx" + "\" }";
                    //menu += "]}";

                    //menu += ",{\"key\": \"10\", \"title\": \"Report\", \"folder\": true, \"children\": [";
                    //menu += "{\"key\": \"7\", \"title\": \"Employee KPI\", \"href\": \"../Pages/KPICurrentAdmin.aspx" + "\"}";
                    //menu += "]}";

                    //menu += ",{\"key\": \"9\", \"title\": \"Log Aplikasi\", \"href\": \"../Pages/sysLogPage.aspx" + "\"}";



                }
                else if (isAssignee && isBreakDown)
                {


                    //menu += ",{\"key\": \"3\", \"title\": \"Employee KPI\", \"href\": \"../Pages/KPICurrent.aspx" + "\"}";
                    menu += ",{\"key\": \"4\", \"title\": \"KPI\", \"folder\": true, \"children\": [";



                    if (isAddKPI == false && isPickKPI == false)
                    {
                        menu += "{\"key\": \"4_3\", \"title\": \"Breakdown KPI\", \"href\": \"../Pages/KPIBreakDownPage.aspx" + "\" }";
                        menu += ",{\"key\": \"4_4\", \"title\": \"Assign KPI\", \"href\": \"../Pages/KPIAssignDetailPage.aspx" + "\" }";
                        menu += ",{\"key\": \"4_5\", \"title\": \"Achievement\", \"href\": \"../Pages/AchievementPage.aspx" + "\" }";
                        menu += ",{\"key\": \"4_6\", \"title\": \"Verification\", \"href\": \"../Pages/VerificatePage.aspx" + "\" }";



                        menu += "]}";

                        menu += ",{\"key\": \"5\", \"title\": \"Report\", \"folder\": true, \"children\": [";
                        menu += "{\"key\": \"5_1\", \"title\": \"Annual Report\", \"href\": \"../Pages/ReportAnnualKPIPage.aspx" + "\" }";
                        menu += ",{\"key\": \"5_2\", \"title\": \"KPI Handover\", \"href\": \"../Pages/ReportKPIReceiptPage.aspx" + "\" }";
                        menu += ",{\"key\": \"5_3\", \"title\": \"KPI Manual\", \"href\": \"../Pages/ReportKPIManualPage.aspx" + "\" }";

                        menu += "]}";
                    }
                    else
                    {

                        if (isPickKPI)
                        {
                            menu += "{\"key\": \"4_2\", \"title\": \"Available KPI\", \"href\": \"../Pages/AvailableKPIPage.aspx" + "\" }";
                            menu += ",{\"key\": \"4_3\", \"title\": \"Breakdown KPI\", \"href\": \"../Pages/KPIBreakDownPage.aspx" + "\" }";
                        }
                        else
                        {
                            menu += "{\"key\": \"4_3\", \"title\": \"Breakdown KPI\", \"href\": \"../Pages/KPIBreakDownPage.aspx" + "\" }";
                        }


                        menu += ",{\"key\": \"4_4\", \"title\": \"Assign KPI\", \"href\": \"../Pages/KPIAssignDetailPage.aspx" + "\" }";
                        menu += ",{\"key\": \"4_5\", \"title\": \"Achievement\", \"href\": \"../Pages/AchievementPage.aspx" + "\" }";
                        menu += ",{\"key\": \"4_6\", \"title\": \"Verification\", \"href\": \"../Pages/VerificatePage.aspx" + "\" }";

                        if (isAddKPI)
                        {
                            menu += ",{\"key\": \"4_7\", \"title\": \"Add KPI\", \"href\": \"../Pages/KPIAddPage.aspx" + "\" }";
                        }

                        menu += "]}";

                        menu += ",{\"key\": \"5\", \"title\": \"Report\", \"folder\": true, \"children\": [";
                        menu += "{\"key\": \"3\", \"title\": \"Employee KPI\", \"href\": \"../Pages/KPICurrent.aspx" + "\"}";
                        menu += ",{\"key\": \"5_4\", \"title\": \"Employee KPI Weight\", \"href\": \"../Pages/EmployeeKPITotalWeightPage.aspx" + "\" }";
                        menu += ",{\"key\": \"5_1\", \"title\": \"Annual Report\", \"href\": \"../Pages/ReportAnnualKPIPage.aspx" + "\" }";
                        menu += ",{\"key\": \"5_2\", \"title\": \"KPI Handover\", \"href\": \"../Pages/ReportKPIReceiptPage.aspx" + "\" }";
                        menu += ",{\"key\": \"5_3\", \"title\": \"KPI Manual\", \"href\": \"../Pages/ReportKPIManualPage.aspx" + "\" }";

                        menu += "]}";
                    }


                }
                else
                {

                    menu += ",{\"key\": \"3\", \"title\": \"KPI\", \"folder\": true, \"children\": [";
                    menu += "{\"key\": \"3_1\", \"title\": \"Achievement\", \"href\": \"../Pages/AchievementPage.aspx" + "\" }";
                    menu += "]}";

                    menu += ",{\"key\": \"4\", \"title\": \"Report\", \"folder\": true, \"children\": [";
                    menu += "{\"key\": \"4_1\", \"title\": \"Annual Report\", \"href\": \"../Pages/ReportAnnualKPIPage.aspx" + "\" }";
                    menu += ",{\"key\": \"4_2\", \"title\": \"KPI Handover\", \"href\": \"../Pages/ReportKPIReceiptPage" + "\" }";
                    menu += ",{\"key\": \"4_3\", \"title\": \"KPI Manual\", \"href\": \"../Pages/ReportKPIManualPage.aspx" + "\" }";
                    menu += "]}";
                }

               // menu += "]";
            }
            return menu;
        }

        
    }
}